There is almost one tag for each possible transformation and one for its "contrary".
Actually the plan sets the global transformation requests, and tags alter it on the module and procedure levels.
Standard tags
Tags that are self-explanatory:
vbwErrorHandler / vbwNoErrorHandler: determines if a module or procedure should benefit of an error handling routine.
Note: when it appears inside the procedure itself, this tag must be written right after the procedure declaration.
vbwLineNumbers / vbwNoLineNumbers: turns on/off the line numbering
vbwPresLineNumbers / vbwNoPresLineNumbers: turns on/off the Preserve line Numbers option.
vbwVariableDump / vbwNoVariableDump: determines if, in case of error, the error report should contain the variables contents dump.
vbwTraceProc / vbwNoTraceProc: determines if a call to that procedure should be traced or not. For example, procedures that are called very often and that are guaranteed to work well, may not be very useful to trace but instead would unnecessary slow down the process. E.g.: a classic increment function:
Sub Inc(ByRef arg, Optional v = 1)
' vbwNoTraceProc vbwNoTraceLine
arg = arg + v
End Sub
Note 1: when it appears inside the procedure itself, this tag must be written right after the procedure declaration.
Note 2: the vbwNoTraceProc tag does not exempt from writing the vbwNoTraceLine tag.
vbwTraceParameters / vbwNoTraceParameters: determines if the call trace should include the value of parameters.
Note: when it appears inside the procedure itself, this tag must be written right after the procedure declaration.
vbwTraceLine / vbwNoTraceLine: turns on/off line tracing.
vbwInstanceCount / vbwNoInstanceCount: determines if a form/class/user control's instances should be monitored
Note: this tag must be written in the declaration section of the affected form/class/user control.
vbwDebugPrint / vbwNoDebugPrint: determines if a Debug.Print statement should be transformed so as to monitor its output.
vbwRemoveDebugPrint / vbwNoRemoveDebugPrint: determines if a Debug.Print statement should be removed from the code after being transformed (see above). The fact that it is generally useless to leave a Debug.Print statement in a compiled code.
vbwProfileProc / vbwNoProfileProc: determines if a module or procedure should be profiled or not. See the vbwTraceProc tag description for example of procedures that do not need to be profiled.
Note 1: when it appears inside the procedure itself, this tag must be written right after the procedure declaration.
Note 2: the vbwNoProfileProc tag does not exempt from writing the vbwNoProfileLine tag.
vbwProfileLine / vbwNoProfileLine: turns on/off line profiling.
vbwCritical / vbwNoCritical: this tag is used for code coverage analysis in the VB Watch Profiler and does not affect code instrumentation.
When the Profiler reads this tag in your code, it gives separate results for critical and non critical code. This allows to define 2 class of code: the critical one for which you want 100% coverage, and the other for which you'll be less demanding.
Special tags
Some tags have special use or special meaning:
vbwLocalHandler: use this tag to specify a different local error handling routine for a procedure. The tag is a bit tricky to use since it has a special format: you must put the name of another existing error handling plan like this:
vbwLocalHandler=Simple Error Handler
In the above example, the tagged procedure would receive the local error handler defined in the Simple Error Handler plan.
Note: if no other existing plan contains the local handler you wish, you may have to create a new plan just for this purpose.
vbwNoLocalHandler: use this tag to undo the effects of the previous tag and return to the default local error handler (the one selected in the Plan Manager tab).
vbwExitProc: this tag has a special effect. It forces VB Watch to act as if the next statement was an Exit Sub statement. So VB Watch will write the necessary tracing code to indicate that the procedure is about to be exited.
It is your reponsability to write this tag whenever you know that some code line will cause to exit the current procedure, such as an Err.Raise statement without error handler. Otherwise the trace and the call stack may be wrong.
Note: VB Watch recognizes the End Sub/Function/Property and Exit Sub/Function/Property statements so you don't need to worry about them.
Example: look at the vbwExceptionFilter function of the \VB Watch 2\Templates\VB6\Protector\vbwProtector.bas template file.
vbwNoExitProc: this tags prevents VB Watch from writing an Exit Sub/Function/Property statement at the end of a procedure before writing the local error handler routine. This allows to have your own specific error handler catching known errors and let the VB Watch routine handle unknown's.
Example: Here is the original procedure:
Sub ExampleSub()
On Error GoTo MyHandler
...Things to do...
Exit Sub
MyHandler:
If Err.Number = 9 Then Resume Next
'vbwNoExitProc
End Sub
And the procedure after process:
Sub ExampleSub()
On Error GoTo vbwErrHandler ' (this one is void)
On Error GoTo MyHandler ' (this one prevails)
...Things to do...
Exit Sub
MyHandler:
If Err.Number = 9 Then Resume Next
'vbwNoExitProc
vbwErrHandler:
Select Case MsgBox("Error " & Err.Number & vbCrLf & _
Err.Description & vbCrLf & _
"Location: " & VBWPROJECT & "." & VBWMODULE & "." & VBWPROCEDURE & vbCrLf & _
"Line " & Erl, _
vbAbortRetryIgnore)
Case vbAbort
End
Case vbRetry
Resume
Case vbIgnore
Resume Next
End Select
End Sub
Without the vbwNoExitProc tag, the added error handling routine would
never be executed because of an Exit Sub statement added right before vbwErrHandler:
.
vbwStop: this tag is only used with the VB Watch Debugger. Use it to set a breakpoint, so that the execution stops whenever it comes across this tag.